* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: 'PingFang SC', BlinkMacSystemFont, Roboto, 'Helvetica Neue',
    sans-serif;
}

input,
button,
textarea {
  font-family: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: normal;
}

em {
  font-style: normal !important;
}

section {
  height: 100%;
}

.web-title {
  margin: 0 15px 0 5px;
}

.web-icon {
  width: auto;
  height: 1.5rem;
  vertical-align: middle;
}

#editor {
  display: block;
  height: 100%;
  width: 100%;
  padding: 10px;
  border: none;
}

.ctrl {
  flex-basis: 60px;
  flex-grow: 1;
  flex-shrink: 1;
  display: flex;
  align-items: center;
}

.preview-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow-y: auto;
  background-color: #f5f5f5;
}

.hint {
  opacity: 0.6;
  margin: 20px 0;
}

.preview {
  position: relative;
  margin: 20px;
  width: 375px;
  min-height: calc(100% - 40px);
  padding: 0;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  word-wrap: break-word;
  background: #fff;
  border-radius: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;

  .status-bar {
    position: relative;
    z-index: 100;
    height: 44px;
    padding: 0 16px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    border-radius: 40px 40px 0 0;
    flex-shrink: 0;

    &__time {
      &::before {
        content: attr(data-time);
      }
    }

    &__right {
      display: flex;
      align-items: center;
      gap: 4px;

      .signal {
        &::before {
          content: '5G';
          font-weight: 500;
        }
      }

      .battery {
        width: 25px;
        height: 12px;
        border: 1px solid #000;
        border-radius: 2px;
        position: relative;
        
        &::before {
          content: '';
          position: absolute;
          left: 2px;
          top: 2px;
          width: 19px;
          height: 6px;
          background: #000;
          border-radius: 1px;
        }

        &::after {
          content: '';
          position: absolute;
          right: -4px;
          top: 3px;
          width: 2px;
          height: 4px;
          background: #000;
          border-radius: 0 1px 1px 0;
        }
      }
    }
  }

  .wechat-nav {
    position: relative;
    z-index: 100;
    height: 44px;
    padding: 0 16px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;

    &::before {
      content: '微信公众号';
    }
  }

  #output {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
  }

  .dark & {
    background: #1a1a1a;
    
    .status-bar, .wechat-nav {
      background: #1a1a1a;
      color: #fff;
    }

    .battery {
      border-color: #fff;
      &::before, &::after {
        background: #fff;
      }
    }

    .wechat-nav {
      border-bottom-color: #333;
    }
  }
}

.preview table {
  margin-bottom: 10px;
  border-collapse: collapse;
  display: table;
  width: 100% !important;
}
